pp108 : getClasses Method

getClasses Method


This method retrieves all classes of a particular style sheet.

Syntax


styleID.getClasses(sName, fpCallBack)

Parameters

Parameter

Description

sName

Required. String that specifies the name of the style sheet for which the classes are to be retrieved.

fpCallBack

Required. Pointer that specifies the function to call after getting the classes.


Return Value


No return value.

Remarks


The method first starts the style monitor, if it is not started and then retrieves the classes belonging to a particular style sheet.

The getClasses() method does not return the classes directly as a return value to the function, instead it returns the data as an array to the callback function associated with it. Thus, the classes array is a parameter of the callback function, which can be used to get the information about the classes for that particular style sheet.

The array returned contains all the standard classes defined by the Process Platform Ajax Toolkit framework, along with new classes that are added for that style sheet.

Example


The following example shows how this method is used.

<!-- style definition --> <div cordysType="wcp.library.ui.Style" id="style" > ... </div> <!-- Method invocation - Get the classes for the style sheet 'cordys' --> <input type="button" value="Get Classes" onclick="style.getClasses('cordys', callBack)"> <!-- Function called --> function callBack(allClasses) { var alertMessage = "All Classes : \n\n"; for (index in allClasses) { alertMessage += "\t" + allClasses[index] + "\n\n"; } application.notify(alertMessage); }

See Also


style